package stmo.栈;

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;

/**
 *  引入js中的函数eval，将字符串转换为表达式
 */


public class Test {

    public static void main(String[] args) throws Exception {

        ScriptEngine jse = new ScriptEngineManager().getEngineByName("JavaScript");
        String s = "+";
        int b = (int) jse.eval(3+s+8);
        System.out.println(b);
    }
}
